APPNAME=server

PREFIX ?=`pwd`/../../bin 

#定义一个变量指定文件和安装路径

LIBPATH= `pwd`/../../lib/ 


CFLAGS+=-I `pwd`/../../include/  
CFLAGS+=-I `pwd`/../../sqlite/include/ 
LDFLAGS+=-L ${LIBPATH} -ldatabase  -llogger  
LDFLAGS+=-L `pwd`/../../sqlite/lib/ -lsqlite3


CC=gcc
AR=ar 

all: 
	${CC} ${CFLAGS} server_epoll.c -o ${APPNAME} ${LDFLAGS}

clean:
	rm -f ${APPNAME}
	rm -f *.so
	rm -f *.a

distclean:clean
	rm -f *.log

run:
	export LD_LIBRARY_PATH=`pwd`/../../lib/:/`pwd`/../../sqlite/lib/ && ./${APPNAME}  -p 9999 

install:
	mkdir -p ${PREFIX}
	cp ${APPNAME} ${PREFIX}
